package com.advice.control.controller;

import com.advice.control.exception.UserNotAuthorityException;
import com.advice.control.exception.UserNotExistException;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created with IDEA
 * author:zwj
 * Date:2019/2/21
 * Time:20:40
 */
@RestController
public class TestController {

    @RequestMapping("/test/{id}")
    public Map<String,Object> get(@PathVariable String id) {
        throw new UserNotAuthorityException();
    }

    @RequestMapping("/user/{id}")
    public Map<String,Object> getUser(@PathVariable String id) {
        throw new UserNotExistException(id);
    }

}
